package com.ray.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class webController implements Controller
{
    /**
     * @param request
     * @param response
     * @return
     * @throws Exception
     */
    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception
    {
        String name = request.getParameter("name");

        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("msg","Hello spring mvc! " + name);
        modelAndView.setViewName("hello");
        return modelAndView;
    }
}
